<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>admin/test/css/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>admin/test/css/icon.css">
	<script type="text/javascript" src="<%=basePath %>admin/test/js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>admin/test/js/jquery.easyui.min.js"></script>
	<!-- 额外配置文件 -->
	<script type="text/javascript" src="<%=basePath %>admin/test/js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>admin/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>admin/js/easyui-lang-zh_CN.js"></script>
	
		<link rel="stylesheet" type="text/css" href="<%=basePath %>admin/js/jquery-1.4.4.min.js">
		<script type="text/javascript" src="<%=basePath %>admin/js/jquery.datepick.js"></script>  
    <link type="text/css" href="<%=basePath %>admin/test/css/flora.datepick.css" rel="stylesheet">
<script type="text/javascript" src="<%=basePath %>admin/js/jquery.datepick-zh-CN.js"></script>  
	
	<!-- 额外配置文件 -->
	
	<style>
		input, textarea{
			border:1px solid #ccc;
			margin-bottom:5px;
		}
	</style>
	<script type="text/javascript">
	function adminPage()
	{
	  
	  window.location.href="<%=basePath%>admin/index.jsp";
	}
	function zhuanjiaPage()
	{
	   window.location.href="<%=basePath%>admin/Zhuanjia/zhuanjiaIndex.jsp";
	}
	function hospitalPage()
	{
	   window.location.href="<%=basePath%>admin/HospitalIndex.jsp";
	}
	function wst()
	{
	    window.location.href="<%=basePath%>admin/wst/wst.jsp";
	}
	</script>
	<script type="text/javascript">
		$(function(){
			var dlg = $('#dlg1').dialog({
				iconCls: 'icon-save',
				width:400,
				modal:true,
				buttons:{
					'登录':function()
					{
					
					
						
					},
					'取消':function(){
						$('#dlg1').dialog({closed:true});
					}
				}
			});
		});
       
		function open1(){
			$('#dlg1').dialog({
				closed:false,
				showType:null//'show'
			});
		}
		function close1(){
			$('#dlg1').dialog({
				closed:true
			});
		}
		function denglu()
		{
		
		  var shenfen=document.getElementById("shenfen").value;
		  var adminName=document.getElementById("adminName").value;
		   var adminPwd=document.getElementById("adminPwd").value;
		   if(shenfen=='身份选择')
		   {
		     $.messager.alert('提醒','请先选择登录身份','info');
		     return;
		   }
		    if(adminName=='')
		   {
		     $.messager.alert('提醒','请输入用户名','info');
		     return;
		   }
		   if(adminPwd=='')
		   {
		     $.messager.alert('提醒','请输入密码','info');
		     return;
		   }
		  	$.ajax({
				   type: 'post',
				   url: "adminLoginadminAction",
				   data: "shenfen="+shenfen+"\t"+adminName+"\t"+adminPwd,
				   success: function(data)
				   {
				     if(data=='ok')
				     {
						$.messager.alert('提醒','登录成功','info');
		
					}
					if(data=='error')
					{
						$.messager.alert('提醒','用户名获取密码错误','info');
					}
					if(data=='admin')
					{
					         
		 			   adminPage();
					            
					}
					if(data=='zhuanjia')
					{
					  zhuanjiaPage();
					}
					if(data=='hospital')
					{
					  hospitalPage();
					}
					if(data=='wst')
					{
					  wst();
					}
				  }
			});
		}
		
	</script>
</head>
<body>
	<a href="#" onclick="open1();">后台登录</a>
	<div id="dlg1"  style="width:320px;" title="后台用户登录">
	<form id="login" name="login" method="post" action="">
		<div style="padding:20px;">
			
			<div style="padding-bottom: 10px;">身份选择:
			<select id="shenfen" name="shenfen" style="width: 150px;">
			<option value="身份选择">请选择身份</option>
			<option value="卫生厅">卫生厅</option>
			<option value="管理员">管理员</option>
			<option value="医院管理员">医院管理员</option>
			<option value="专家">专家</option>
			</select></div>
	
			<div style="padding-bottom: 10px;">
			 用户名:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="adminName" id="adminName" style="width:150px;"/>
			 </div>
			<div style="padding-bottom: 10px;">
			密&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" name="adminPwd" id="adminPwd" style="width:150px;"/>
			</div>
	       <div> <a  href="javascript:denglu();"   class="l-btn" icon="icon-save">登录</a>
	        <a href="javascript:close1();" class="l-btn" icon="icon-cancel">取消</a>
	        </div>
		</div>
		</form>
	</div>
</body>
</html>